1. Field of the Invention
The present invention generally relates to the field of video encoding and/or decoding, and more particularly to a video encoder and/or decoder for encoding video data into data complying with a predetermined encoding standard and decoding data complying with the predetermined standard into video data, and to a method of controlling the operation timing of a video encoder and/or decoder.
This application claims the priority of the Japanese Patent Application No. 2002-210166 filed on Jul. 18, 2002, the entirety of which is incorporated by reference herein.
2. Background Discussion
The video codec (coder/decoder, namely provided with both encoding and decoding functions) supporting MPEG-2 (ISO/IEC 13818-2), MPEG-4 (ISO/IEC 14496-2) or the like is well known.
FIGS. 1 to 3 show first to third conventional video codecs, respectively; FIG. 1 schematically shows the construction of the first conventional video codec (generally indicated with a reference 101), FIG. 2 shows the construction of the second conventional video codec (generally indicated with a reference 102), and FIG. 3 shows the construction of the third conventional video codec (generally indicated with a reference 103).
As shown, each of the first to third conventional video codecs 101 to 103 includes a video input module 111, codec module 112 and a video output module 113 as main components.
When in the encoding mode of operation, each of the first to third conventional video codecs 101 to 103 is supplied with external baseband video data. When in the mode of decoding, it is supplied with external coded data.
The video input module 111 is used when the video codec is in the coding mode. It is supplied with baseband video data from outside. It stores the external video data into a memory and makes input processing of the video data, both in units of a frame. The baseband video data thus processed in the video input module 111 is supplied to the codec module 112.
When the video codec is in the encoding, the codec module 112 is supplied with baseband video data from the video input module 111 as above. On the other hand, when the video codec is in the decoding mode, the codec module 112 is supplied with external coded data. When the video codec is in the encoding mode, the codec module 112 encodes the input baseband video data to provide coded data. On the other hand, when the video codec is in the decoding mode, the codec module 112 will decode the supplied external coded data to provide baseband video data.
When the video codec is in the decoding mode, the video output module 113 is put into operation. It is supplied with baseband video data from the codec module 112, and stores the input base-band video data and makes output processing of the video data, both frame by frame. The base-band vide data thus processed in the video output module 113 is delivered to outside.
When the video codec is in the encoding mode, each of the aforementioned first to third conventional video codecs 101 to 103 delivers coded data generated by the codec module 112 to outside. When the video codec is in the decoding mode, it delivers baseband video data processed in the video output module 113 to outside.
In the first conventional video codec 101, an external frame sync (FS) is supplied to the video input module 111, codec module 112 and video output module 113. The external frame sync is a signal indicative of a sync timing of frame (or field) of base-band video data the video codec. Upon reception of the external frame sync as a start pulse, the modules 111 to 113 in the first conventional video codec 101 will start input processing and output processing and encoding and decoding, respectively, both in units of a frame.
Therefore, the first conventional video codec 101 can make the frame input/output processing synchronously with the external frame sync and the frame encoding/decoding synchronously with the external frame sync.
In the second conventional video codec 102, the video input and output modules 111 and 113 are supplied with an external frame sync. Upon reception of the external frame sync as a start pulse, each of the video input and output modules 111 and 113 in the second conventional video codec 102 start input processing and output processing, respectively, in units of a frame. Further, the second conventional video codec 102 has provided therein a processor 114 which controls the timing of encode and decode start of the codec module 112 and sets the video input and output modules 111 and 113. The processor 114 accepts the external frame sync as an interrupt signal, and supplies a encode/decode start signal to the codec module 112 according to the timing in which it has accepted the external frame sync. Upon acceptance of the encode/decode start signal, the codec module 112 starts data encoding or decoding for one frame. Also, upon acceptance of the external frame sync, the processor 114 sets a parameter or the like necessary for the frame input processing and output processing in the video input and output modules 111 and 113, respectively, at a time in which it has accepted the external frame sync. For example, the processor 114 will set a storage location for an input or output frame by setting a memory address or the like in the video input and output modules 111 and 113.
The aforementioned second conventional video codec 102 can make input/output processing of a frame synchronously with the external frame sync and frame encoding and decoding synchronously with the external frame sync. Also, the second conventional video codec 102 can easily make adjustment of encoding and decoding timing such as suspension of the encoding and decoding because the processor 114 controls the timing of encoding and decoding. Therefore, the second conventional video codec 102 can easily thin frames, for example.
In the third conventional video codec 103, the video input and output modules 111 and 113 are supplied with an external frame sync. Upon reception of the external frame sync as a start pulse, each of the video input and output modules 111 and 113 in the third conventional video codec 103 start input processing and output processing, respectively, in units of a frame. Further, the third conventional video codec 103 has provide therein a processor 114 which controls the encode and decode start of the codec module 112. The processor 114 accepts a reference signal not synchronous with the external frame sync (a timing signal generated on the basis of a clock signal in baseband video data or timing signal generated on the basis of a system clock signal for the video codec 103, for example) as an interrupt signal, and supplies a encode/decode start signal to the codec module 112 according to the time in which it has accepted the reference signal. Upon acceptance of the encode/decode start signal, the codec module 112 starts data encoding or decoding for one frame.
The aforementioned third conventional video codec 103 can make input/output processing of a frame synchronously with the external frame sync. Also the third conventional video codes 103 can make encoding and decoding asynchronously with the external frame sync because the processor 114 controls the timing of encoding and decoding according to the reference signal not synchronous with the external frame sync. Further, the third conventional video codec 103 can generate a start pulse for the video input and output modules 111 and 113 on the basis of the reference signal, so it can encode and decode data even when no external frame sync is available.
In the first conventional video codec 101, however, it is difficult to adjust the timing of encoding and decoding for synchronization with other signal (audio signal, for example). For example, in the first conventional video codec 101, it is difficult to suspend decoding for only one frame. On the other hand, the second conventional video codec 102 can easily adjust the encoding and decoding timing because the processor 114 controls the timing of encoding and decoding. In the second conventional video codec 102, however, increase or decrease of data throughput in the processor 114 will cause a jitter in timing of setting the video input and output modules 111 and 113. In such a case, the video input and output modules 111 and 113 will be set at a time before or after the external frame sync, which will cause base-band video data to be input/output-processed with an unsteady timing.
Also, in the second conventional video codec 102, it is difficult to encode and decode data on the basis of a reference signal not synchronous with the external frame sync, and also the encoding and decoding themselves are difficult when no external frame sync is supplied. On the other hand, the third conventional video codec 103 can encode and decode data on the basis of a reference signal not synchronous with the external frame sync and also even when no external frame signal is supplied. However, the third conventional video codec 103 cannot encode and decode data synchronously or asynchronously with the external frame sync.